﻿using System;
using System.Diagnostics;
using Tekla.Structures.Extensions.Events;

namespace DetailManager.Tools
{
    public class MyListener: TraceListener
    {
        public MyListener()
        { }

        public event EventHandler<StringArg> WriteOccured;
        public override void Write(string message)
        {
            if (WriteOccured != null)
                WriteOccured.BeginInvoke(null, new StringArg(message), null, null);
        }

        public event EventHandler<StringArg> WriteLineOccured;
        public override void WriteLine(string message)
        {
            if (WriteLineOccured != null)
                WriteLineOccured.BeginInvoke(null, new StringArg(message), null, null);
        }
    }
}